//
//  ViewController.swift
//  YJTeacher_Demo_Swift
//
//  Created by upplus on 2023/9/11.
//

import UIKit
import YJTeacher

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "点击屏幕跳转"
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        // normal
        let vc = FJTea_WebViewController(token: "e5daad7d-758e-4420-81c7-90f21b12ff25") // 传入token
        navigationController?.pushViewController(vc, animated: true)
        
        // detail
        let dic: NSDictionary = [
            "name": "practiceDetail",
            "params": [
                "homeworkId": "FD43DC088474A8ECB10BA99314D3BB31", // 练习卷（子作业）id
                "classHomeworkPaperId": "FD43DC088574445ACF7844F93C6046D5" //练习卷（子作业）名称
            ]
        ]
        let vc = FJTea_WebViewController(token: "e5daad7d-758e-4420-81c7-90f21b12ff25", parameters: dic) // 传入token
        vc.delegate = self
        navigationController?.pushViewController(vc, animated: true)
    }

}

extension ViewController: FJTea_WebViewControllerDelegate {
    func yijiaTeacherViewControllerClosed() {
        print("sdk关闭了")
    }
}
